<template>
    <CommentListHeader title="全部评论" />
    <CommentView :comment="item" v-for="(item, index) in comment" :key="index" />
</template>
<script setup lang="ts">
import { ref, reactive, onMounted } from "vue"
import api from "../../api/index"
import CommentListHeader from "../../components/PubHeaderComponent.vue"
import CommentView from "./CommentView.vue"

/**
 * 获取评论
 */
interface IComment {
    id: number,
    icon: string,
    name: string,
    rate: number,
    time: string,
    text: string,
    images: []
}

const comment = ref<IComment[]>()

onMounted(() => {
    api.getCommentAll().then(res => {
        if (res.data.status == 200) {
            comment.value = res.data.data
        }
    })
})

</script>
<style lang="less" scoped></style>
